<template>
  <div class="inline-block">
    <div v-for="(photo, index) in photos" :key="index" class="inline-block">
      <div v-if="photo" :ref="'photo'+index" class="mr15 vertical-top inline-block relative">
        <span class="user-avatar-mask align-center white fs20 absolute">
          <span
            class="user-avatar-delete absolute pointer"
            @click="handleDeleteUserAvatar(photo, 'photo'+index)"
          >
            <i class="el-icon-delete"></i>
          </span>
        </span>
        <img :src="photo" class="detail-photo" alt />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Thumbnail",
  methods: {
    handleDeleteUserAvatar(delUrl, ref) {
      this.$refs[ref][0].style.display = "none";
      this.$emit("deleteUserAvatar", delUrl);
    }
  },
  props: ["photos"]
};
</script>
 
<style scoped>
</style>